package com.oceansoft.mobile.econsole.modules.log.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.oceansoft.mobile.econsole.common.util.web.PageUtil;
import com.oceansoft.mobile.econsole.modules.accident.entity.AccidentInfo;
import com.oceansoft.mobile.econsole.modules.apps.entity.AppDownload;
import com.oceansoft.mobile.econsole.modules.base.entity.Pager;
import com.oceansoft.mobile.econsole.modules.base.entity.Query;
import com.oceansoft.mobile.econsole.modules.log.persistence.ILoginLogMapper;
import com.oceansoft.mobile.econsole.modules.log.service.ILoginLogService;
import com.oceansoft.mobile.econsole.modules.member.entity.Member;

@Service
public class LoginLogServiceImpl implements ILoginLogService {
	@Resource 
	private ILoginLogMapper loginLogMapper;

	@Override
	public Pager<Member> getLoginLogPager(Query query) {
		PageHelper.startPage(query.getPageNum(), query.getNumPerPage(), true);
		Page<Member> page = (Page<Member>) loginLogMapper
				.findPageByCondition(query);
		return PageUtil.page2pager(page, query);
}
	
	  public Pager<Member> findLoginMainByCondition(Query query) {
	        PageHelper.startPage(query.getPageNum(), query.getNumPerPage(), true);
	        Page<Member> page = (Page<Member>) loginLogMapper.findLoginMainPageByCondition(query);
	        return PageUtil.page2pager(page, query);
	    }
	  
	  
		@Override
		public List<Member> loadExcel(Query query){
			List<Member> list=loginLogMapper.findExeclByCondition(query);
			return list;
		} 
}
